package com.peaker.advertisingpro.db.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.peaker.advertisingpro.bean.ProgramUrlBean
import com.peaker.advertisingpro.bean.ResPlayNum
import com.peaker.advertisingpro.bean.SwitchDateBean

/**
 * 开关机时间 表
 */
@Dao
interface SwitchDao :BaseDao<SwitchDateBean> {

    /**
     * 获取指定 类型的 设置开关机的额json 数据
     */
    @Query("SELECT json FROM switchtimedb WHERE type = :type")
    fun getsetJson(type: String): String

    /**
     * 获取所有
     *
     */
    @Query("SELECT * FROM switchtimedb")
    fun getAllSetJson(): MutableList<SwitchDateBean>

    /**
     * 清表
     */

    @Query("DELETE FROM switchtimedb")
    fun deletAll()

    /**
     * 插入
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(entitie: SwitchDateBean?)

    @Query("insert into switchtimedb (type,json) values (:type,:json)")
    fun insert(type:String,json:String)


}